import { httpUrl } from 'api/config';
import { ajaxPost } from 'api/axios';
import { changeDataType } from 'common/js/util';

export function getIpList() {
	let url = `${httpUrl}/file/listIp`;
	
	let data = {};
	
	return ajaxPost(url, changeDataType(data))
		.then(res => {
			return Promise.resolve(res)
		})
		.catch(res => {
			return Promise.reject(res)
		})
}

export function getData(server) {
	let url = `${httpUrl}/appserver/systeminfo`;
	
	let data = {
		server: server
	};
	
	return ajaxPost(url, changeDataType(data))
		.then(res => {
			return Promise.resolve(res)
		})
		.catch(res => {
			return Promise.reject(res)
		})
}